package com.xucan.catchx;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Throwablex {
    public static void myMethod() {
       for (int i = 0; i < 5; i++) {
           for (int j = 0; j < 5; j++) {
              System.out.println("*");
              if (j == 3) {
                return;
              }
            }
           System.out.println("=========sa");

       }
        System.out.println("===xxx======sa");
    }
    public static void main(String[] args) {
        myMethod();
        try {
            ArrayList<Object> objects = new ArrayList<>();
            objects.add("1");
            objects.add("12");
            objects.add("13");
            objects.add("14");
            objects.add("15");
            List<Object> subList = objects.subList(0, 3);
            System.out.println(subList);



            Map<String, String> map = new HashMap<>();
            map.put("x", "chaoshen");
            map.put("6", "xucan");
            map.put("x", "chaoshen1");
            String s = map.get("x");
            System.out.println(s);

            // 可能会抛出异常的代码
        } catch (Throwable t) {
            // 处理异常的代码
        }
    }
}
